<template>
    <div>
        <button>返回</button>
        
        <span>{{ title }}</span>

        <button>首页</button>
    </div>
</template>

<script>
import store from './store'

export default {
    data(){
        return {
            title:"首页"
        }
    },
    mounted(){
        store.subscribe((value)=>{
console.log('订阅发布模式',value);
this.title=value;
})
    }
}
</script>

<style scoped>
div{
    display: flex;
    width: 100%;
    justify-content: space-between;
    height: 50px;
    line-height: 50px;
    background: gray;
}
</style>